package com.hxht.cmp.controller;


import com.hxht.cmp.common.result.ResultResponse;
import com.hxht.cmp.entity.Video;
import com.hxht.cmp.service.CaseVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 视频信息
 */
@RestController
@RequestMapping("/video")
public class CaseVideoController {

    @Autowired
    private CaseVideoService caseVideoService;


    /**
     * 视频图像信息
     *
     * @param trialUid
     * @return
     */
    @RequestMapping("/selectPlayVideo")
    @ResponseBody
    public ResultResponse selectPlayVideo(String trialUid) {
        List<Video> videos = caseVideoService.selectPlayVideo(trialUid);
        return ObjectUtils.isEmpty(videos) ? ResultResponse.failed() : ResultResponse.success(videos);
    }


    /**
     * 笔录信息
     *
     * @param trialUid
     * @param courtUid
     * @return
     */
    @RequestMapping("courtrecForId")
    @ResponseBody
    public ResultResponse courtrecForId(String trialUid, String courtUid) {
        List<String> result = caseVideoService.courtrecForId(trialUid, courtUid);
        return ObjectUtils.isEmpty(result) ? ResultResponse.failed() : ResultResponse.success(result);
    }


}
